﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace HYTools.ExportNavisworks
{
	public class FloorComparer : IComparer<ViewPlan>
	{
		public FloorComparer(List<Level> sortedLevels)
		{
			this.m_SortedLevels = sortedLevels;
		}

		public int Compare(ViewPlan lhv, ViewPlan rhv)
		{
			int nId1 = lhv.GenLevel.Id.IntegerValue;
			int num = this.m_SortedLevels.FindIndex((Level value) => value.Id.IntegerValue == nId1);
			int nId2 = rhv.GenLevel.Id.IntegerValue;
			int value2 = this.m_SortedLevels.FindIndex((Level value) => value.Id.IntegerValue == nId2);
			return num.CompareTo(value2);
		}

		private List<Level> m_SortedLevels;
	}
}
